import { edgeExtensionSegs } from './link.js'
import { neighbourSegCrossPoints } from './segCross.js'
// 芒星
export const starPoints = (points) => {
    let len = points.length
    let segs = edgeExtensionSegs(points, len > 6 ? 0 : 1)
    let lcps = neighbourSegCrossPoints(segs)
    let result = []

    points.forEach((t, i) => {
        result.push(t)
        result.push(lcps[(i - 1 >= 0) ? (i - 1) : (len - 1)])

    })
    return result
}